package club.xyes.zkh.ecommerce.commons.vo;

import club.xyes.zkh.ecommerce.commons.entity.ShopMembershipLevel;
import lombok.Data;

/**
 * Create by 郭文梁 2019/4/26 0026 17:32
 * ShopMembershipLevelText
 * 店铺会员描述文本信息
 *
 * @author 郭文梁
 * @data 2019/4/26 0026
 */
@Data
public class ShopMembershipLevelText {
    /**
     * 从登记对象创建描述信息
     *
     * @param level 等级对象
     * @return 描述信息
     */
    public static ShopMembershipLevelText of(ShopMembershipLevel level) {
        String text = level.toDescriptionText();
        ShopMembershipLevelText res = new ShopMembershipLevelText();
        res.text = text;
        res.levelName = level.getName();
        res.levelValue = level.getLevelValue();
        return res;
    }

    private Integer levelValue;
    private String levelName;
    private String text;
}
